package cl.rizepe.playntest.core.views;

import java.util.HashMap;

public class LayerPropertyAnimationHashmap {
	public static enum Properties {width,heigth,originX,originY, translateX,translateY,rotation,scaleX,scaleY, alpha};
	public  static class AnimatedProperty<E extends Number> {
		E start;
		E end;
		float step;
		float time=0;

		public AnimatedProperty (E start, E end, float time){
			this.start=start;
			this.end=end;
			this.time=time;
			setStep();
		}
		
		

		public E getStart(){
			return start;
		}
		
		public void setStart(E start){
			this.start =start;
			setStep();
		}
		
		public float getTime() {
			return time;
		}

		public void setTime(float time) {
			this.time = time;
			setStep();
		}

		public E getEnd(){
			return end;
		}
		
		public void setEnd(E end){
			this.end =end;
			setStep();
		}
		
	   protected void setStep(){
		   if (start!=null&&end!=null&&time!=0)			
			   step=(end.floatValue()-start.floatValue())/time;
	   };
		
		public float getStep(){
			return step;
		}
	}

	@SuppressWarnings("rawtypes")
	HashMap<Properties,AnimatedProperty> hashMap;
	
	@SuppressWarnings("rawtypes")
	public LayerPropertyAnimationHashmap(){
		hashMap= new HashMap<Properties,AnimatedProperty>();
		hashMap.put(Properties.width, new AnimatedProperty<Float>(8f,8f,2f));
	}
	
	public void t(){
		//AnimatedProperty<Float> f = new AnimatedProperty<Float>(8f,8f,2f);
	}

}
